{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "db231ed8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  Python\n",
      "11\n",
      "2\n",
      "\n"
     ]
    }
   ],
   "source": [
    "str1 = \"hello\"\n",
    "str2 = \"python\"\n",
    "str3 = \"\"\"  Python\n",
    "11\n",
    "2\n",
    "\"\"\"\n",
    "\n",
    "print(str3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "4a605275",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "he\n",
      "llo\n",
      "l\n"
     ]
    }
   ],
   "source": [
    "#字符串也能切片 [起始:结束:步长]\n",
    "print(str1)\n",
    "\n",
    "print(str1[:2])\n",
    "print(str1[2:])\n",
    "print(str1[2:-2])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
